package com.lsm.czxxgl_system.Configuration;

import com.lsm.czxxgl_system.Interceptor.PageInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName: WebMvcConfiguration
 * Package: com.lsm.czxxgl_system.Configuration
 * Description:
 *
 * @Author lsm
 * @Create 2024/6/26 23:27
 * @Version 1.0
 */
@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {
    @Autowired
    PageInterceptor pageInterceptor;
    /**
     * 配置拦截器
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(pageInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/","/user/login","/css/**","/fonts/**","/images/**","/js/**");
    }
}
